<!doctype html>



  


<html class="theme-next muse use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  
    
      
    

    
  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Microsoft YaHei:300,300italic,400,400italic,700,700italic|consolas:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="bolg,git,hexo,github," />








  <link rel="shortcut icon" type="image/x-icon" href="http://ofy7k3v4s.bkt.clouddn.com/mylogo.png?v=5.0.2" />






<meta name="description" content="Hexo+github&amp;#x53EF;&amp;#x4EE5;&amp;#x968F;&amp;#x5FC3;&amp;#x6240;&amp;#x6B32;&amp;#x7684;&amp;#x90E8;&amp;#x7F72;&amp;#x5C5E;&amp;#x4E8E;&amp;#x81EA;&amp;#x5DF1;&amp;#x7684;&amp;#x535A;&amp;#x5BA2;&amp;#x3002;
Hexo &amp;#x535A;&amp;#x5BA2;&amp;#x642D;&amp;#x5EFA;&amp;#x6B65;&amp;#x9AA4">
<meta property="og:type" content="article">
<meta property="og:title" content="Hexo博客搭建">
<meta property="og:url" content="https://hongqinma.github.io/2015/01/20/Built-Hexo-Blog/index.html">
<meta property="og:site_name" content="HongqinMa' Blog">
<meta property="og:description" content="Hexo+github&amp;#x53EF;&amp;#x4EE5;&amp;#x968F;&amp;#x5FC3;&amp;#x6240;&amp;#x6B32;&amp;#x7684;&amp;#x90E8;&amp;#x7F72;&amp;#x5C5E;&amp;#x4E8E;&amp;#x81EA;&amp;#x5DF1;&amp;#x7684;&amp;#x535A;&amp;#x5BA2;&amp;#x3002;
Hexo &amp;#x535A;&amp;#x5BA2;&amp;#x642D;&amp;#x5EFA;&amp;#x6B65;&amp;#x9AA4">
<meta property="og:updated_time" content="2016-11-21T04:01:57.579Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Hexo博客搭建">
<meta name="twitter:description" content="Hexo+github&amp;#x53EF;&amp;#x4EE5;&amp;#x968F;&amp;#x5FC3;&amp;#x6240;&amp;#x6B32;&amp;#x7684;&amp;#x90E8;&amp;#x7F72;&amp;#x5C5E;&amp;#x4E8E;&amp;#x81EA;&amp;#x5DF1;&amp;#x7684;&amp;#x535A;&amp;#x5BA2;&amp;#x3002;
Hexo &amp;#x535A;&amp;#x5BA2;&amp;#x642D;&amp;#x5EFA;&amp;#x6B65;&amp;#x9AA4">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '6347850919329138000',
      author: 'Hiraku'
    }
  };
</script>




  <link rel="canonical" href="https://hongqinma.github.io/2015/01/20/Built-Hexo-Blog/"/>


  <title> Hexo博客搭建 | HongqinMa' Blog </title>
</head>

<body itemscope itemtype="//schema.org/WebPage" lang="en">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?10010323";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="//schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta custom-logo">
  
    <div class="site-meta-headline">
      <a>
        <img class="custom-logo-image" src="http://ofy7k3v4s.bkt.clouddn.com/photo.jpg"
             alt="HongqinMa' Blog"/>
      </a>
    </div>
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">HongqinMa' Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">Spell at all costs， to rush you in the future。</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            Tags
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="//schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                Hexo博客搭建
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2015-01-20T22:37:57+08:00" content="2015-01-20">
              2015-01-20
            </time>
          </span>

          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2015/01/20/Built-Hexo-Blog/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2015/01/20/Built-Hexo-Blog/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          

          
              &nbsp; | &nbsp;
              <span class="page-pv"><i class="fa fa-file-o"></i>
              <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>
              </span>
          

          
            <span id="busuanzi_container_page_pv">  <span id="busuanzi_value_page_pv"></span> Views</span>
          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>Hexo+github&#x53EF;&#x4EE5;&#x968F;&#x5FC3;&#x6240;&#x6B32;&#x7684;&#x90E8;&#x7F72;&#x5C5E;&#x4E8E;&#x81EA;&#x5DF1;&#x7684;&#x535A;&#x5BA2;&#x3002;</p>
<h2 id="Hexo-&#x535A;&#x5BA2;&#x642D;&#x5EFA;&#x6B65;&#x9AA4;"><a href="#Hexo-&#x535A;&#x5BA2;&#x642D;&#x5EFA;&#x6B65;&#x9AA4;" class="headerlink" title="Hexo &#x535A;&#x5BA2;&#x642D;&#x5EFA;&#x6B65;&#x9AA4;"></a>Hexo &#x535A;&#x5BA2;&#x642D;&#x5EFA;&#x6B65;&#x9AA4;</h2><h2 id="&#x642D;&#x5EFA;&#x535A;&#x5BA2;&#xFF0C;&#x9996;&#x5148;&#x9700;&#x8981;&#x5B89;&#x88C5;-node-&#x73AF;&#x5883;&#xFF1B;"><a href="#&#x642D;&#x5EFA;&#x535A;&#x5BA2;&#xFF0C;&#x9996;&#x5148;&#x9700;&#x8981;&#x5B89;&#x88C5;-node-&#x73AF;&#x5883;&#xFF1B;" class="headerlink" title="&#x642D;&#x5EFA;&#x535A;&#x5BA2;&#xFF0C;&#x9996;&#x5148;&#x9700;&#x8981;&#x5B89;&#x88C5; node &#x73AF;&#x5883;&#xFF1B;"></a>&#x642D;&#x5EFA;&#x535A;&#x5BA2;&#xFF0C;&#x9996;&#x5148;&#x9700;&#x8981;&#x5B89;&#x88C5; <code>node</code> &#x73AF;&#x5883;&#xFF1B;</h2><ul>
<li>&#x6D4B;&#x8BD5;&#x5B89;&#x88C5;&#x6210;&#x529F;&#x4E0E;&#x5426;&#xFF1A;&#x6253;&#x5F00;&#x7EC8;&#x7AEF;&#xFF0C;&#x8F93;&#x5165; <code>node -v</code>, &#x6709;&#x8F93;&#x51FA;&#x7248;&#x672C;&#x7ED3;&#x679C;&#x5219;&#x5B89;&#x88C5;&#x6210;&#x529F;&#x3002;</li>
<li>&#x5B89;&#x88C5;node&#x73AF;&#x5883;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5DF2;&#x7ECF;&#x81EA;&#x52A8;&#x5B89;&#x88C5;&#x4E86; npm &#x547D;&#x4EE4;&#x884C;&#x5DE5;&#x5177;&#xFF0C;&#x4E0D;&#x9700;&#x8981;&#x5355;&#x72EC;&#x5B89;&#x88C5;&#x3002;</li>
<li>&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>npm -v</code> &#x6D4B;&#x8BD5;npm&#x662F;&#x5426;&#x53EF;&#x7528;</li>
</ul>
<p>npm &#x662F;&#x4E00;&#x4E2A;&#x7528;&#x6765;&#x5B89;&#x88C5;&#x548C;&#x7BA1;&#x7406; Node &#x5305;&#x548C;&#x524D;&#x7AEF;&#x5305;&#x7684;&#x4E00;&#x4E2A;&#x5DE5;&#x5177;&#x3002;</p>
<h3 id="npm-&#x7684;&#x4E24;&#x5C42;&#x542B;&#x4E49;"><a href="#npm-&#x7684;&#x4E24;&#x5C42;&#x542B;&#x4E49;" class="headerlink" title="npm &#x7684;&#x4E24;&#x5C42;&#x542B;&#x4E49;"></a>npm &#x7684;&#x4E24;&#x5C42;&#x542B;&#x4E49;</h3><ul>
<li>npm&#x7F51;&#x7AD9;&#xFF1A;<a href="https://www.npmjs.com/" target="_blank" rel="external">https://www.npmjs.com/</a><ul>
<li>&#x4E00;&#x4E2A;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#x7528;&#x6765;&#x5171;&#x4EAB;&#x6216;&#x8005;&#x68C0;&#x7D22;&#x7684;&#x4E00;&#x4E2A;&#x5E73;&#x53F0;</li>
<li>&#x4E8C;&#x662F;&#x6258;&#x7BA1; node &#x73AF;&#x5883;&#x6216;&#x8005;&#x6D4F;&#x89C8;&#x5668;&#x73AF;&#x5883;&#x7528;&#x5230;&#x7684;&#x4E00;&#x4E9B;&#x7B2C;&#x4E09;&#x65B9;&#x5305;</li>
</ul>
</li>
<li>&#x662F;&#x4E00;&#x4E2A;&#x547D;&#x4EE4;&#x884C;&#x5DE5;&#x5177;&#xFF0C;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x4E0B;&#x8F7D; npm &#x7F51;&#x7AD9;&#x4E0A;&#x6258;&#x7BA1;&#x7684;&#x5305;<ul>
<li>CLI&#xFF1A;Command Line Interface &#x547D;&#x4EE4;&#x884C;&#x63A5;&#x53E3;</li>
<li>GUI&#xFF1A;&#x56FE;&#x5F62;&#x5316;&#x63A5;&#x53E3;</li>
</ul>
</li>
</ul>
<h3 id="npm-&#x57FA;&#x672C;&#x4F7F;&#x7528;"><a href="#npm-&#x57FA;&#x672C;&#x4F7F;&#x7528;" class="headerlink" title="npm &#x57FA;&#x672C;&#x4F7F;&#x7528;"></a>npm &#x57FA;&#x672C;&#x4F7F;&#x7528;</h3><h4 id="&#x672C;&#x5730;&#x5B89;&#x88C5;"><a href="#&#x672C;&#x5730;&#x5B89;&#x88C5;" class="headerlink" title="&#x672C;&#x5730;&#x5B89;&#x88C5;"></a>&#x672C;&#x5730;&#x5B89;&#x88C5;</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ npm install [--save] &#x5305;&#x540D;</div></pre></td></tr></table></figure>
<p>&#x4E00;&#x822C;&#x662F;&#x5728;&#x9879;&#x76EE;&#x4E2D;&#xFF0C;&#x5B89;&#x88C5;&#x9879;&#x76EE;&#x4F7F;&#x7528;&#x7684;&#x4F9D;&#x8D56;&#x5305;,&#x5C31;&#x53EF;&#x4EE5;&#x5728;&#x7EC8;&#x7AEF;&#x4E2D;&#xFF0C;&#x5207;&#x6362;&#x5230;&#x9879;&#x76EE;&#x7684;&#x6839;&#x76EE;&#x5F55;&#xFF0C;&#x7136;&#x540E;&#x6267;&#x884C; <code>npm install &#x5305;&#x540D;</code>&#xFF0C;npm &#x5DE5;&#x5177;&#x4F1A;&#x81EA;&#x52A8;&#x5C06;&#x8FD9;&#x4E2A;&#x5305;&#x4E0B;&#x8F7D;&#x4E0B;&#x6765;&#x7136;&#x540E;&#x653E;&#x5230; <code>node_modules</code> &#x76EE;&#x5F55;&#x4E2D;&#x3002;node_modules &#x76EE;&#x5F55;&#x5982;&#x679C;&#x4E0D;&#x5B58;&#x5728;&#x4F1A;&#x65B0;&#x5EFA;&#xFF0C;&#x5982;&#x679C;&#x5DF2;&#x5B58;&#x5728;&#xFF0C;&#x5219;&#x76F4;&#x63A5;&#x5C06;&#x4E0B;&#x8F7D;&#x7684;&#x5305;&#x653E;&#x5230;&#x8BE5;&#x76EE;&#x5F55;&#x4E2D;&#x3002;</p>
<h4 id="&#x5305;&#x8BF4;&#x660E;&#x6587;&#x4EF6;&#xFF1A;package-json"><a href="#&#x5305;&#x8BF4;&#x660E;&#x6587;&#x4EF6;&#xFF1A;package-json" class="headerlink" title="&#x5305;&#x8BF4;&#x660E;&#x6587;&#x4EF6;&#xFF1A;package.json"></a>&#x5305;&#x8BF4;&#x660E;&#x6587;&#x4EF6;&#xFF1A;package.json</h4><p>&#x5305;&#x8BF4;&#x660E;&#x6587;&#x4EF6;&#x5176;&#x5B9E;&#x5C31;&#x662F;&#x4E00;&#x4E2A;&#x4EA7;&#x54C1;&#x7684;&#x8BF4;&#x660E;&#x4E66;&#xFF1A;<code>package.json</code> &#x6587;&#x4EF6;&#x3002;&#x8BE5;&#x6587;&#x4EF6;&#x4E00;&#x822C;&#x53EA;&#x5B58;&#x5728;&#x4E8E;&#x9879;&#x76EE;&#x7684;&#x6839;&#x8DEF;&#x5F84;&#x4E0B;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>npm init</code> &#x547D;&#x4EE4;&#x4F7F;&#x7528;&#x5411;&#x5BFC;&#x7684;&#x5F62;&#x5F0F;&#x521B;&#x5EFA;&#x8BE5;&#x6587;&#x4EF6;&#x3002;</p>
<p>&#x8BE5;&#x6587;&#x4EF6;&#x4E2D;&#x63CF;&#x8FF0;&#x4E86;&#x9879;&#x76EE;&#x7684;&#x4E00;&#x4E9B;&#x5143;&#x6570;&#x636E;&#xFF0C;&#x4F8B;&#x5982; <code>name&#x3001;version&#x3001;author</code> &#x7B49;&#x4FE1;&#x606F;&#x3002;</p>
<p>&#x5176;&#x4E2D;&#x6709;&#x4E00;&#x4E2A;&#x975E;&#x5E38;&#x91CD;&#x8981;&#x7684;&#x5C5E;&#x6027;&#xFF0C;&#x53EB;&#x505A;&#xFF1A;<code>dependencies</code>&#xFF0C;&#x8BE5;&#x5C5E;&#x6027;&#x662F;&#x4E00;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x91CC;&#x9762;&#x4FDD;&#x5B58;&#x4E86;&#x5F53;&#x524D;&#x9879;&#x76EE;&#x7684;&#x4F9D;&#x8D56;&#x9879;&#xFF0C;&#x8BE5;&#x5B57;&#x6BB5;&#x4E00;&#x822C;&#x4E0D;&#x8981;&#x624B;&#x52A8;&#x4FEE;&#x6539;&#xFF0C;&#x5B83;&#x9700;&#x8981;&#x7ED3;&#x5408; <code>npm install --save &#x5305;&#x540D;</code> &#x6765;&#x4F7F;&#x7528;&#xFF0C;&#x53EA;&#x8981;&#x5728;&#x5B89;&#x88C5;&#x7684;&#x65F6;&#x5019;&#x52A0;&#x4E0A; <code>--save</code> &#x53C2;&#x6570;&#x5C31;&#x4F1A;&#x81EA;&#x52A8;&#x5C06;&#x5305;&#x4F9D;&#x8D56;&#x9879;&#x6DFB;&#x52A0;&#x5230;&#x8BE5;&#x5C5E;&#x6027;&#x4E2D;&#xFF0C;&#x5F88;&#x65B9;&#x4FBF;&#x3002;</p>
<p>&#x751A;&#x81F3;&#x8FD8;&#x53EF;&#x4EE5;&#x5B8C;&#x5168;&#x628A; <code>node_modules</code> &#x76EE;&#x5F55;&#x5220;&#x9664;&#x6389;&#xFF0C;&#x53EA;&#x8981; <code>package.json</code> &#x6587;&#x4EF6;&#x8FD8;&#x5728;&#xFF0C;&#x5C31;&#x53EF;&#x4EE5;&#x6267;&#x884C; <code>npm install</code> &#x5B89;&#x88C5;&#x5305;&#x8BF4;&#x660E;&#x6587;&#x4EF6;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x7684;&#x4F9D;&#x8D56;&#x9879;&#x3002;&#x6267;&#x884C; <code>npm install</code> &#x547D;&#x4EE4;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5B83;&#x4F1A;&#x81EA;&#x52A8;&#x67E5;&#x8BE2;&#x5F53;&#x524D;&#x76EE;&#x5F55;&#x4E0B;&#x7684; <code>package.json</code> &#x6587;&#x4EF6;&#xFF0C;&#x7136;&#x540E;&#x627E;&#x5230;&#x91CC;&#x9762;&#x7684; <code>dependencies</code> &#x5C5E;&#x6027;&#xFF0C;&#x4F9D;&#x6B21;&#x4E0B;&#x8F7D;&#x5230; <code>node_modules</code> &#x76EE;&#x5F55;&#x4E0B;&#x3002;</p>
<p>&#x5EFA;&#x8BAE;&#x4F7F;&#x7528; npm &#x7684;&#x65F6;&#x5019;&#xFF0C;&#x90FD;&#x5148;&#x521D;&#x59CB;&#x5316;&#x4E00;&#x4E2A; <code>package.json</code> &#x6587;&#x4EF6;&#xFF0C;&#x7136;&#x540E;&#x5B89;&#x88C5;&#x5305;&#x7684;&#x65F6;&#x5019;&#x6700;&#x597D;&#x90FD;&#x52A0;&#x4E0A; <code>--save</code> &#x53C2;&#x6570;&#xFF0C;&#x5C06;&#x4F9D;&#x8D56;&#x9879;&#x6DFB;&#x52A0;&#x5230;&#x5305;&#x8BF4;&#x660E;&#x6587;&#x4EF6;&#x4E2D;&#x3002;</p>
<h4 id="&#x5168;&#x5C40;&#x5B89;&#x88C5;"><a href="#&#x5168;&#x5C40;&#x5B89;&#x88C5;" class="headerlink" title="&#x5168;&#x5C40;&#x5B89;&#x88C5;"></a>&#x5168;&#x5C40;&#x5B89;&#x88C5;</h4><p>&#x5168;&#x5C40;&#x5B89;&#x88C5;&#xFF1A;&#x4E00;&#x822C;&#x7528;&#x4E8E;&#x5B89;&#x88C5;&#x4E00;&#x4E9B;&#x547D;&#x4EE4;&#x884C;&#x5DE5;&#x5177;&#xFF08;&#x8FD9;&#x4E9B;&#x5DE5;&#x5177;&#x4E5F;&#x662F;&#x57FA;&#x4E8E;Node&#x5F00;&#x53D1;&#x7684;&#x3002;&#xFF09;</p>
<p>&#x5168;&#x5C40;&#x5B89;&#x88C5;&#x4F7F;&#x7528; <code>npm install --global &#x5305;&#x540D;&#xFF08;&#x5DE5;&#x5177;&#x540D;&#xFF09;</code>&#xFF0C;&#x5728;&#x4EFB;&#x610F;&#x76EE;&#x5F55;&#x6267;&#x884C;&#x8BE5;&#x547D;&#x4EE4;&#x90FD;&#x53EF;&#x4EE5;&#x3002;</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">npm i -g hexo-cli</div></pre></td></tr></table></figure>
<p>&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>npm root -g</code> &#x67E5;&#x770B;&#x5168;&#x5C40;&#x5305;&#x5B89;&#x88C5;&#x76EE;&#x5F55;&#x3002;</p>
<h2 id="&#x5B89;&#x88C5;-git-&#x73AF;&#x5883;&#xFF1B;"><a href="#&#x5B89;&#x88C5;-git-&#x73AF;&#x5883;&#xFF1B;" class="headerlink" title="&#x5B89;&#x88C5; git &#x73AF;&#x5883;&#xFF1B;"></a>&#x5B89;&#x88C5; <code>git</code> &#x73AF;&#x5883;&#xFF1B;</h2><p><a href="https://git-for-windows.github.io/" target="_blank" rel="external">&#x4E0B;&#x8F7D;&#x5730;&#x5740;&#xFF1A;</a></p>
<h3 id="&#x521D;&#x59CB;&#x8BBE;&#x7F6E;"><a href="#&#x521D;&#x59CB;&#x8BBE;&#x7F6E;" class="headerlink" title="&#x521D;&#x59CB;&#x8BBE;&#x7F6E;"></a>&#x521D;&#x59CB;&#x8BBE;&#x7F6E;</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">$ git config --global user.name <span class="string">&quot;yourname&quot;</span></div><div class="line">$ git config --global user.email <span class="string">&quot;your_email@example.com&quot;</span></div></pre></td></tr></table></figure>
<h2 id="&#x5168;&#x5C40;&#x5B89;&#x88C5;-hexo-cli"><a href="#&#x5168;&#x5C40;&#x5B89;&#x88C5;-hexo-cli" class="headerlink" title="&#x5168;&#x5C40;&#x5B89;&#x88C5; hexo-cli"></a>&#x5168;&#x5C40;&#x5B89;&#x88C5; <code>hexo-cli</code></h2><p>&#x5728;&#x7EC8;&#x7AEF;&#x7684;&#x4EFB;&#x610F;&#x76EE;&#x5F55;&#x8F93;&#x5165; <code>npm install -g hexo-cli</code> &#x7136;&#x540E;&#x56DE;&#x8F66;&#x6267;&#x884C;&#x7B49;&#x5F85;&#x5168;&#x5C40;&#x5B89;&#x88C5;&#x6210;&#x529F;</p>
<p>&#x901A;&#x8FC7;&#x8F93;&#x5165; <code>hexo --version</code> &#x5982;&#x679C;&#x770B;&#x5230;&#x8F93;&#x5165;&#x4E00;&#x5927;&#x5806;&#x7684;&#x7248;&#x672C;&#x53F7;&#x5C31;&#x8BF4;&#x660E;&#x5B89;&#x88C5;&#x6210;&#x529F;&#x4E86;&#xFF0C;Hexo &#x662F;&#x4E00;&#x4E2A;&#x547D;&#x4EE4;&#x884C;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;</p>
<h2 id="&#x521D;&#x59CB;&#x5316;&#x4E00;&#x4E2A;&#x535A;&#x5BA2;&#x5B58;&#x50A8;&#x76EE;&#x5F55;"><a href="#&#x521D;&#x59CB;&#x5316;&#x4E00;&#x4E2A;&#x535A;&#x5BA2;&#x5B58;&#x50A8;&#x76EE;&#x5F55;" class="headerlink" title="&#x521D;&#x59CB;&#x5316;&#x4E00;&#x4E2A;&#x535A;&#x5BA2;&#x5B58;&#x50A8;&#x76EE;&#x5F55;"></a>&#x521D;&#x59CB;&#x5316;&#x4E00;&#x4E2A;&#x535A;&#x5BA2;&#x5B58;&#x50A8;&#x76EE;&#x5F55;</h2><p>&#x901A;&#x8FC7;&#x8F93;&#x5165; <code>hexp init &#x535A;&#x5BA2;&#x9879;&#x76EE;&#x5B58;&#x50A8;&#x76EE;&#x5F55;</code></p>
<p>Hexo &#x4F1A;&#x5728;&#x6267;&#x884C;&#x8BE5;&#x547D;&#x4EE4;&#x7684;&#x76EE;&#x5F55;&#x4E0B;&#x751F;&#x6210;&#x4E00;&#x4E2A;&#x535A;&#x5BA2;&#x9879;&#x76EE;&#xFF0C;&#x521D;&#x59CB;&#x5316;&#x535A;&#x5BA2;&#x9879;&#x76EE;&#x7684;&#x8FC7;&#x7A0B;&#x9700;&#x8981;&#x8054;&#x7F51;</p>
<p>&#x901A;&#x8FC7;&#x7EC8;&#x7AEF;&#x8FDB;&#x5165;&#x521A;&#x624D;&#x521B;&#x5EFA;&#x7684;&#x535A;&#x5BA2;&#x9879;&#x76EE;&#x76EE;&#x5F55;&#xFF0C;&#x7136;&#x540E;&#x5728;&#x8BE5;&#x76EE;&#x5F55;&#x4E0B;&#x8F93;&#x5165; <code>npm install</code> &#x56DE;&#x8F66;&#x7B49;&#x5F85;&#x6267;&#x884C;&#x7ED3;&#x675F;</p>
<h2 id="&#x542F;&#x52A8;&#x672C;&#x5730;&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x67E5;&#x770B;&#x535A;&#x5BA2;&#x5185;&#x5BB9;"><a href="#&#x542F;&#x52A8;&#x672C;&#x5730;&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x67E5;&#x770B;&#x535A;&#x5BA2;&#x5185;&#x5BB9;" class="headerlink" title="&#x542F;&#x52A8;&#x672C;&#x5730;&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x67E5;&#x770B;&#x535A;&#x5BA2;&#x5185;&#x5BB9;"></a>&#x542F;&#x52A8;&#x672C;&#x5730;&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x67E5;&#x770B;&#x535A;&#x5BA2;&#x5185;&#x5BB9;</h2><p>&#x8F93;&#x5165; <code>hexo server</code> &#x56DE;&#x8F66;&#x6267;&#x884C;&#xFF0C;&#x8FD9;&#x4E00;&#x6267;&#x884C;&#x4F1A;&#x5728;&#x672C;&#x5730;&#x542F;&#x52A8;&#x4E00;&#x4E2A;&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x7136;&#x540E;&#x901A;&#x8FC7; <code>http://localhost:4000</code> &#x5C31;&#x53EF;&#x4EE5;&#x8BBF;&#x95EE;&#x521B;&#x5EFA;&#x7684;&#x535A;&#x5BA2;&#x9879;&#x76EE;</p>
<h2 id="&#x521B;&#x5EFA;&#x535A;&#x6587;"><a href="#&#x521B;&#x5EFA;&#x535A;&#x6587;" class="headerlink" title="&#x521B;&#x5EFA;&#x535A;&#x6587;"></a>&#x521B;&#x5EFA;&#x535A;&#x6587;</h2><p>&#x8FDB;&#x5165;&#x535A;&#x5BA2;&#x9879;&#x76EE;&#xFF0C;&#x8F93;&#x5165; <code>hexo new &#x6587;&#x7AE0;&#x540D;&#x79F0;</code> &#x521B;&#x5EFA;&#x535A;&#x5BA2;</p>
<p>&#x8FD9;&#x4E2A;&#x547D;&#x4EE4;&#x4F1A;&#x81EA;&#x52A8;&#x5728; source/_posts/ &#x76EE;&#x5F55;&#x4E0B;&#x751F;&#x6210;&#x4E00;&#x4E2A; &#x6587;&#x7AE0;&#x540D;&#x79F0;.md &#x6587;&#x4EF6;</p>
<h2 id="&#x751F;&#x6210;&#x9759;&#x6001;&#x6587;&#x4EF6;&#xFF1A;hexo-generate"><a href="#&#x751F;&#x6210;&#x9759;&#x6001;&#x6587;&#x4EF6;&#xFF1A;hexo-generate" class="headerlink" title="&#x751F;&#x6210;&#x9759;&#x6001;&#x6587;&#x4EF6;&#xFF1A;hexo generate"></a>&#x751F;&#x6210;&#x9759;&#x6001;&#x6587;&#x4EF6;&#xFF1A;<code>hexo generate</code></h2><p>&#x8BE5;&#x547D;&#x4EE4;&#x4F1A;&#x81EA;&#x52A8;&#x5728;&#x9879;&#x76EE;&#x7684;&#x6839;&#x76EE;&#x5F55;&#x4E0B;&#x7684; public &#x76EE;&#x5F55;&#x4E0B;&#x964D;&#x9759;&#x6001;&#x6587;&#x4EF6;&#x653E;&#x8FDB;&#x53BB;</p>
<h2 id="&#x914D;&#x7F6E;&#x4E3B;&#x9898;&#x9875;"><a href="#&#x914D;&#x7F6E;&#x4E3B;&#x9898;&#x9875;" class="headerlink" title="&#x914D;&#x7F6E;&#x4E3B;&#x9898;&#x9875;"></a>&#x914D;&#x7F6E;&#x4E3B;&#x9898;&#x9875;</h2><p>&#x6839;&#x636E;&#x6211;&#x4E2A;&#x4EBA;&#x6240;&#x9009;&#x7684;&#x4E3B;&#x9898;&#x4ECB;&#x7ECD;&#x3002;&#x8FDB;&#x5165;&#x535A;&#x5BA2;&#x6839;&#x76EE;&#x5F55;&#xFF0C;&#x6253;&#x5F00;_config&#x5F00;&#x59CB;&#x914D;&#x7F6E;&#xFF0C;&#x6CE8;&#x610F;&#xFF1A;&#x5728;&#x914D;&#x7F6E;&#x4E3B;&#x9898;&#x9875;&#x7684;&#x65F6;&#x5019;&#x9700;&#x8981;&#x56FE;&#x7247;&#x7684;url&#xFF0C;&#x9700;&#x8981;&#x5728;<a href="https://portal.qiniu.com" target="_blank" rel="external">&#x4E03;&#x5934;&#x4E91;CDN</a>&#x6CE8;&#x518C;&#xFF1B;</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div></pre></td><td class="code"><pre><div class="line"># Site</div><div class="line">title: HongqinMa  # &#x914D;&#x7F6E;&#x535A;&#x5BA2;&#x6807;&#x9898;</div><div class="line">subtitle: &quot;&#x535A;&#x5BA2;&#x6807;&#x7B7E;&quot;</div><div class="line">description: &quot;&#x9A6C;&#x7EA2;&#x7434;&#x5728; Github &#x4E0A;&#x7684;&#x4E2A;&#x4EBA;&#x535A;&#x5BA2;&quot;</div><div class="line">author: Hongqin Ma</div><div class="line"></div><div class="line">header-img: //ofy7k3v4s.bkt.clouddn.com/mbanner.png  #</div><div class="line">email: hongqin_ma@126.com  # &#x90AE;&#x7BB1;&#x5730;&#x5740;</div><div class="line">keyword: Hiraku, HongqinMa, javascript, html, css, nodejs  #SEO&#x641C;&#x7D22;&#x5F15;&#x64CE;&#x67E5;&#x627E;&#x5173;&#x952E;&#x8BCD;</div><div class="line">favicon: //ofy7k3v4s.bkt.clouddn.com/mylogo.png  # &#x535A;&#x5BA2;&#x7F51;&#x7AD9;&#x56FE;&#x6807;</div><div class="line"></div><div class="line"># RSS:</div><div class="line">weibo_username: Hiraku_Ma #&#x5FAE;&#x535A;&#x8D26;&#x6237;&#x540D;</div><div class="line">zhihu_username: HirakuMa #&#x77E5;&#x4E4E;&#x8D26;&#x6237;&#x540D;</div><div class="line">github_username: HongqinMa #github&#x8D26;&#x6237;&#x540D;</div><div class="line">twitter_username: HongqinMa #Twitter&#x8D26;&#x6237;&#x540D;</div><div class="line">facebook_username: Hiraku #Facebook&#x8D26;&#x6237;&#x540D;</div><div class="line"></div><div class="line">sidebar-about-description: &#x62FC;&#x7740;&#x4E00;&#x5207;&#x4EE3;&#x4EF7;&#xFF0C;&#x5954;&#x4F60;&#x7684;&#x524D;&#x7A0B;&#x3002; # &#x4FA7;&#x8FB9;&#x680F;&#x7B7E;&#x540D;</div><div class="line">sidebar-avatar: http://ofy7k3v4s.bkt.clouddn.com/photo.jpg # &#x4FA7;&#x8FB9;&#x680F;&#x5934;&#x50CF;</div><div class="line"></div><div class="line">cdn-url: &quot;https://ofy7k3v4s.bkt.clouddn.com/&quot; # &#x6211;&#x5199;&#x7684;&#x662F;&#x4E03;&#x5934;&#x4E91;&#x7684;&#x57DF;&#x540D;&#x5730;&#x5740;</div><div class="line"></div><div class="line">theme: hexo-theme-Anisina  # &#x4E3B;&#x9898;&#x540D;&#x79F0;</div><div class="line"></div><div class="line">friends: [</div><div class="line">  {</div><div class="line">    title: &quot;&#x6398;&#x91D1;&quot;,</div><div class="line">    href: &quot;http://gold.xitu.io/&quot;</div><div class="line">  },</div><div class="line">  {</div><div class="line">    title: &quot;segmentfault&quot;,</div><div class="line">    href: &quot;https://segmentfault.com/&quot;</div><div class="line">  },</div><div class="line">  {</div><div class="line">    title: &quot;&#x7B80;&#x4E66;&quot;,</div><div class="line">    href: &quot;http://www.jianshu.com/users/1cbb94e5ed4d/latest_articles&quot;</div><div class="line">  },</div><div class="line">  {</div><div class="line">    title: &quot;&#x4E03;&#x725B;&#x4E91;&quot;,</div><div class="line">    href: &quot;https://portal.qiniu.com/&quot;</div><div class="line">  },</div><div class="line">  {</div><div class="line">    title: &quot;&#x535A;&#x5BA2;&#x56ED;&quot;,</div><div class="line">    href: &quot;https://home.cnblogs.com/&quot;</div><div class="line">  },</div><div class="line">  {</div><div class="line">    title: &quot;Awesomes&quot;,</div><div class="line">    href: &quot;https://www.awesomes.cn/&quot;</div><div class="line">  }</div><div class="line"></div><div class="line">]</div><div class="line"></div><div class="line">duoshuo_username: Hiraku #&#x8FD9;&#x91CC;&#x9700;&#x8981;&#x6CE8;&#x518C;&#x591A;&#x8BF4;&#x6216;&#x8005;&#x4E3B;&#x9898;&#x4F5C;&#x8005;&#xFF1A;haojen Ma &#x6587;&#x6863;&#x4E2D;&#x7684;&#x53E6;&#x5916;&#x4E00;&#x79CD;&#xFF0C;&#x4F5C;&#x7528;&#x90FD;&#x4E00;&#x6837; &#xFF0C;&#x7528;&#x6765;&#x8BC4;&#x8BBA;&#x7684;&#xFF1B;</div><div class="line"></div><div class="line">deploy: </div><div class="line">  type: git # &#x5FEB;&#x901F;&#x90E8;&#x7F72;</div><div class="line">  repo: https://github&#x7528;&#x6237;&#x540D;:github&#x5BC6;&#x7801;@github.com/HongqinMa/HongqinMa.github.io.git</div></pre></td></tr></table></figure>
<h2 id="&#x5FEB;&#x901F;&#x90E8;&#x7F72;"><a href="#&#x5FEB;&#x901F;&#x90E8;&#x7F72;" class="headerlink" title="&#x5FEB;&#x901F;&#x90E8;&#x7F72;"></a>&#x5FEB;&#x901F;&#x90E8;&#x7F72;</h2><ol>
<li>&#x4FEE;&#x6539;&#x914D;&#x7F6E;&#x6587;&#x4EF6;</li>
<li>&#x5728;&#x9879;&#x76EE;&#x6839;&#x8DEF;&#x5F84;&#x4E0B;&#x6267;&#x884C; <code>npm install hexo-deployer-git --save</code> &#x8BE5;&#x547D;&#x4EE4;</li>
<li>&#x63A5;&#x4E0B;&#x6765;&#x5C31;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x8F93;&#x5165; <code>hexo deploy --generate</code> &#x81EA;&#x52A8;&#x53D1;&#x5E03;&#x5230; github &#x4E0A;</li>
</ol>
<h2 id="&#x66F4;&#x8BE6;&#x7EC6;&#x4ECB;&#x7ECD;&#x5982;&#x4E0B;&#xFF1A;"><a href="#&#x66F4;&#x8BE6;&#x7EC6;&#x4ECB;&#x7ECD;&#x5982;&#x4E0B;&#xFF1A;" class="headerlink" title="&#x66F4;&#x8BE6;&#x7EC6;&#x4ECB;&#x7ECD;&#x5982;&#x4E0B;&#xFF1A;"></a>&#x66F4;&#x8BE6;&#x7EC6;&#x4ECB;&#x7ECD;&#x5982;&#x4E0B;&#xFF1A;</h2><p><a href="http://haojen.github.io/2016/08/06/Anisina-%E4%B8%AD%E6%96%87%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/" target="_blank" rel="external">&#x914D;&#x7F6E;&#x4E3B;&#x9898;&#x9875;&#x8BF4;&#x660E;</a></p>
<p>OK&#xFF0C;&#x73B0;&#x5728;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x901A;&#x8FC7;HongqinMa.github.io.git&#x8BBF;&#x95EE;&#x535A;&#x5BA2;&#x4E86;&#x3002;</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>感谢您的支持！</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>打 赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="http://ofy7k3v4s.bkt.clouddn.com/wcpayCode.jpg" alt="Hongqin Ma WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="http://ofy7k3v4s.bkt.clouddn.com/apayCode.jpg" alt="Hongqin Ma Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/bolg/" rel="tag">#bolg</a>
          
            <a href="/tags/git/" rel="tag">#git</a>
          
            <a href="/tags/hexo/" rel="tag">#hexo</a>
          
            <a href="/tags/github/" rel="tag">#github</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2015/01/15/23-Ajax/" rel="next" title="Ajax">
                <i class="fa fa-chevron-left"></i> Ajax
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2015/01/22/CSS3知识体系/" rel="prev" title="CSS3知识体系">
                CSS3知识体系 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2015/01/20/Built-Hexo-Blog/"
     data-title="Hexo博客搭建"
     data-content=""
     data-url="https://hongqinma.github.io/2015/01/20/Built-Hexo-Blog/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2015/01/20/Built-Hexo-Blog/"
           data-title="Hexo博客搭建" data-url="https://hongqinma.github.io/2015/01/20/Built-Hexo-Blog/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="//schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/photo.jpg"
               alt="Hongqin Ma" />
          <p class="site-author-name" itemprop="name">Hongqin Ma</p>
          <p class="site-description motion-element" itemprop="description">Spell at all costs， to rush you in the future. </p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">68</span>
              <span class="site-state-item-name">posts</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">16</span>
                <span class="site-state-item-name">categories</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">57</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/HongqinMa" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/HongqinMa" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://www.facebook.com/profile.php?id=100006581058735" target="_blank" title="Facebook">
                  
                    <i class="fa fa-fw fa-facebook"></i>
                  
                  Facebook
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.zhihu.com/people/HirakuMa" target="_blank" title="知乎">
                  
                    <i class="fa fa-fw fa-share-alt"></i>
                  
                  知乎
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              Links
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/rubylouvre/" title="司徒正美" target="_blank">司徒正美</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/sanshi/" title="三生石上" target="_blank">三生石上</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.cnblogs.com/TomXu/" title="汤姆大叔" target="_blank">汤姆大叔</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://gold.xitu.io/" title="掘金" target="_blank">掘金</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://segmentfault.com/" title="segmentfault" target="_blank">segmentfault</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.jianshu.com/users/1cbb94e5ed4d/latest_articles" title="简书" target="_blank">简书</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://home.cnblogs.com/" title="博客园" target="_blank">博客园</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://www.awesomes.cn/" title="Awesomes" target="_blank">Awesomes</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Hexo-博客搭建步骤"><span class="nav-number">1.</span> <span class="nav-text">Hexo 博客搭建步骤</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#搭建博客，首先需要安装-node-环境；"><span class="nav-number">2.</span> <span class="nav-text">搭建博客，首先需要安装 node 环境；</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#npm-的两层含义"><span class="nav-number">2.1.</span> <span class="nav-text">npm 的两层含义</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#npm-基本使用"><span class="nav-number">2.2.</span> <span class="nav-text">npm 基本使用</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#本地安装"><span class="nav-number">2.2.1.</span> <span class="nav-text">本地安装</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#包说明文件：package-json"><span class="nav-number">2.2.2.</span> <span class="nav-text">包说明文件：package.json</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#全局安装"><span class="nav-number">2.2.3.</span> <span class="nav-text">全局安装</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#安装-git-环境；"><span class="nav-number">3.</span> <span class="nav-text">安装 git 环境；</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#初始设置"><span class="nav-number">3.1.</span> <span class="nav-text">初始设置</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#全局安装-hexo-cli"><span class="nav-number">4.</span> <span class="nav-text">全局安装 hexo-cli</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#初始化一个博客存储目录"><span class="nav-number">5.</span> <span class="nav-text">初始化一个博客存储目录</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#启动本地服务器，查看博客内容"><span class="nav-number">6.</span> <span class="nav-text">启动本地服务器，查看博客内容</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#创建博文"><span class="nav-number">7.</span> <span class="nav-text">创建博文</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#生成静态文件：hexo-generate"><span class="nav-number">8.</span> <span class="nav-text">生成静态文件：hexo generate</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#配置主题页"><span class="nav-number">9.</span> <span class="nav-text">配置主题页</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#快速部署"><span class="nav-number">10.</span> <span class="nav-text">快速部署</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#更详细介绍如下："><span class="nav-number">11.</span> <span class="nav-text">更详细介绍如下：</span></a></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2016</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Hongqin Ma</span>
</div>

<div class="powered-by">
  Powered by <a class="theme-link" href="https://hexo.io">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>

<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span id="busuanzi_container_site_pv">
    &nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;Page Views: <span id="busuanzi_value_site_pv"></span> 
</span>

        

<div class="busuanzi-count">

  <script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv"><i class="fa fa-user"></i><span class="busuanzi-value" id="busuanzi_value_site_uv"></span></span>
  

  
    <span class="site-pv"><i class="fa fa-eye"></i><span class="busuanzi-value" id="busuanzi_value_site_pv"></span></span>
  
  
</div>



        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.2"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.2"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"Hiraku"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  






  
  

  

  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
  <script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  

  
  
  <!-- custom analytics part create by xiamo -->
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
<script>AV.initialize("PPmoIQxeu8Sd21h6Tl9TthNx-gzGzoHsz", "rTvbY2H7DvWzRipiBwn72RQ4");</script>
<script>
function showTime(Counter) {
  var query = new AV.Query(Counter);
  $(".leancloud_visitors").each(function() {
    var url = $(this).attr("id").trim();
    query.equalTo("url", url);
    query.find({
      success: function(results) {
        if (results.length == 0) {
          var content = '0 ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
          return;
        }
        for (var i = 0; i < results.length; i++) {
          var object = results[i];
          var content = object.get('time') + ' ' + $(document.getElementById(url)).text();
          $(document.getElementById(url)).text(content);
        }
      },
      error: function(object, error) {
        console.log("Error: " + error.code + " " + error.message);
      }
    });

  });
}

function addCount(Counter) {
  var Counter = AV.Object.extend("Counter");
  url = $(".leancloud_visitors").attr('id').trim();
  title = $(".leancloud_visitors").attr('data-flag-title').trim();
  var query = new AV.Query(Counter);
  query.equalTo("url", url);
  query.find({
    success: function(results) {
      if (results.length > 0) {
        var counter = results[0];
        counter.fetchWhenSave(true);
        counter.increment("time");
        counter.save(null, {
          success: function(counter) {
            var content =  counter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(counter, error) {
            console.log('Failed to save Visitor num, with error message: ' + error.message);
          }
        });
      } else {
        var newcounter = new Counter();
        newcounter.set("title", title);
        newcounter.set("url", url);
        newcounter.set("time", 1);
        newcounter.save(null, {
          success: function(newcounter) {
              console.log("newcounter.get('time')="+newcounter.get('time'));
            var content = newcounter.get('time') + ' ' + $(document.getElementById(url)).text();
            $(document.getElementById(url)).text(content);
          },
          error: function(newcounter, error) {
            console.log('Failed to create');
          }
        });
      }
    },
    error: function(error) {
      console.log('Error:' + error.code + " " + error.message);
    }
  });
}
$(function() {
  var Counter = AV.Object.extend("Counter");
  if ($('.leancloud_visitors').length == 1) {
    addCount(Counter);
  } else if ($('.post-title-link').length > 1) {
    showTime(Counter);
  }
}); 
</script>

  
</body>
</html>
